import { currentApp, currentMicro } from "@/views/seed-dev";
import HomeEditor from "./src/HomeEditor.vue";
import HomeCreator from "./src/HomeCreator.vue";
import { HomeConfiguration } from "@/views/dev-types";
import HomePropsEditor from "./src/HomePropsEditor.vue";
export { HomeEditor, HomeCreator, HomePropsEditor }

export function save(name: string, data: HomeConfiguration) {console.log('save===', data)
  const microName = currentMicro.value
  if(microName) {
    const micro = currentApp.value.micros[microName]
    micro.homes = micro.homes || {}
    micro.homes[name] = data
  } else {
    const app = currentApp.value
    app.homes = app.homes || {}
    app.homes[name] = data
  }
}